package com.zzyl.nursing.member;

import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.zzyl.common.utils.PageUtils.startPage;

@Api("小程序端护理项目")
@RestController
@RequestMapping("/member/orders/project")
public class ProjectMemberController{
    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     * 查询护理项目列表
     */
    @ApiOperation("查询护理项目列表")
    @GetMapping("/page")
    public TableDataInfo<NursingProject> list(Integer pageNum,Integer pageSize,String name,Integer status)
    {
      return nursingProjectService.pageByNameAndStatus(pageNum,pageSize,name,status);
    }
    @ApiOperation("查询护理项目详细信息")
    @GetMapping("/{id}")
    public R<NursingProject> getInfo(@ApiParam(value = "项目id", required = true)
                                     @PathVariable("id") Long id)
    {
        NursingProject nursingProject = nursingProjectService.selectNursingProjectById(id);
        return R.ok(nursingProject);
    }

}
